<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>云租房管理系统</title>
    <link rel="stylesheet" th:href="@{/front/js/layui/css/layui.css}">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo"><a th:href="@{/admin/index}">云租房后台管理</a></div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a th:text="${session.adminName}">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                </a>
            </li>
            <li class="layui-nav-item"><a th:href="@{/admin_}">退出</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">系统管理</a>
                    <dl class="layui-nav-child">
                        <dd><a  th:href="@{/admin/list}">房屋管理</a></dd>
                        <dd><a  th:href="@{/user/list}">用户管理</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;" id="home_body">

        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © cloudhouse - 云租房
    </div>
</div>
<script th:src="@{/front/js/layui/layui.js}"></script>
<script>
    //JavaScript代码区域
    layui.use(['element', 'jquery'], function(){
        let element = layui.element;
        let $ = layui.jquery;   //得到jquery模块
        //添加点击事件
        $('.layui-nav-child>dd>a').click(function () {
            let url = $(this).attr("data");
            $('#home_body').load(url);
        })
    });
</script>
</body>
</html>